<template>
	<view class="my-card my-flex" @click="btnLink(listData)">
		<view class="left">
			<view class="top">{{ listData.title }}</view>
			<view class="bottom">{{ listData.subTitle }}</view>
		</view>
		<view class="right">
			<up-avatar size="36" shape="square" :src="`${constInfo.srcConst}${listData.url}`"></up-avatar>
		</view>
	</view>
</template>

<script setup>
import { constStore } from '@/store/const.js';
//引入防抖函数
const { constInfo } = constStore();
const props = defineProps({
	listData: {
		type: Object,
		default: () => {}
	}
});
const btnLink = (item) => {
	if (item.id == 1) {
		uni.navigateTo({
			url: '/pages/my/orderList'
		});
	} else if (item.id == 2) {
		uni.makePhoneCall({
			phoneNumber: '400-8825101' //客服
		});
	}
};
</script>

<style lang="scss" scoped>
.my-flex {
	display: flex;
	justify-content: space-between;
	padding: 46rpx;
	.left {
		.top {
			font-weight: 600;
			font-size: 32rpx;
			color: #1a1a1a;
			line-height: 38rpx;
		}
		.bottom {
			font-family: MiSans, MiSans;
			font-weight: 300;
			font-size: 20rpx;
			color: #808080;
			margin-top: 20rpx;
		}
	}
	.right {
	}
}
</style>
